<?php foreach($rs1 as $r)?>
<p>&nbsp;</p>
<div align="center">
  <h1>ตารางกรอกข้อมูลคุณภาพสินค้า Folio Sheet</h1>
</div>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="62%" valign="top"><strong>Data Detail<br />
      <br />
      </strong>
      <table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#94c0d2">
        <tr>
          <td width="12%" height="32" bgcolor="#DAECF4">&nbsp;Type</td>
          <td width="17%" align="center"><?php echo $r['type_of']; ?></td>
          <td width="18%" bgcolor="#DAECF4">&nbsp;Size</td>
          <td width="12%" align="center"><?php echo $r['size']; ?></td>
          <td width="14%" bgcolor="#DAECF4">&nbsp;Date</td>
          <td width="27%" align="center"><?php echo $r['modify_date']; ?></td>
        </tr>
        <tr>
          <td height="30" bgcolor="#DAECF4">&nbsp;Gram</td>
          <td align="center"><?php echo $r['gram']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Lot No.</td>
          <td align="center"><?php echo $r['lot_no']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Shift</td>
          <td align="center"><?php echo $r['shift']; ?></td>
        </tr>
        <tr>
          <td height="30" bgcolor="#DAECF4">&nbsp;Grade</td>
          <td align="center"><?php echo $r['grade']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Position</td>
          <td align="center"><?php echo $r['position']; ?></td>
          <td bgcolor="#DAECF4">&nbsp;Sorter</td>
          <td align="center"><?php echo $r['sorter']; ?></td>
        </tr>
        <tr>
          <td height="30" colspan="6" align="center"><?php if($r["status"] == 1)
    { echo "<h2>Status :: <font color=green>Active</font></h2>";} 
    else 
    {
    	echo "<h2>Status :: <font color=red>No Active</font></h2>";
      
     } 
    ?></td>
        </tr>
      </table></td>
    <td width="38%" valign="top">&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="99%" align="center" class="font">
  <tr>
    <td><table id="grid">
        <thead>
          <tr>
            <th data-field="Properties1">Properties Item</th>
            <th data-field="Value11">Value</th>
            <th data-field="Value12">Value</th>
            <th data-field="Unit1">Unit</th>
            <th data-field="Properties2">Properties Item</th>
            <th data-field="Value21">Value</th>
            <th data-field="Value22">Value</th>
            <th data-field="Unit2">Unit</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>พื้นที่สกปรก ( Dirt )</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS12')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS12')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>ppm.</td>
            <td><strong>ฉลากสินค้า/คุณภาพการหีบห่อ</strong></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS22')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS22')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>จำนวนแผ่นสกปรก /45 แผ่น</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS13')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS13')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>แผ่น</td>
            <td>แกรม</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS23')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS23')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ถูกต้อง,   2= ไม่ถูกต้อง</td>
          </tr>
          <tr>
            <td>ลักษณะขุยกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS14')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS14')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>No.</td>
            <td>ขนาด</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS24')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS24')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ถูกต้อง,   2= ไม่ถูกต้อง</td>
          </tr>
          <tr>
            <td>การวางแนวเกรนกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS15')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS15')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1=Long grain,2=Shot grain</td>
            <td>Mat no.</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS25')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS25')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ถูกต้อง,   2= ไม่ถูกต้อง</td>
          </tr>
          <tr>
            <td>จำนวนแผ่น (500 แผ่น)</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS16')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS16')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>แผ่น</td>
            <td>Lot no.</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS26')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS26')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ถูกต้อง,   2= ไม่ถูกต้อง</td>
          </tr>
          <tr>
            <td>ขนาดแผ่นกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS17')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS17')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>จำนวนรีม</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS27')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS27')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>รีม</td>
          </tr>
          <tr>
            <td>ฉากกระดาษ ด้านกว้าง</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS18')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS18')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>ความสูงตั้ง</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS28')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS28')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>cm.</td>
          </tr>
          <tr>
            <td>ฉากกระดาษ ด้านยาว</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS19')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS19')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>สภาพตั้ง/ห่อรีม</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS29')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS29')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1.ผ่าน, 2.ไม่ผ่าน</td>
          </tr>
          <tr>
            <td>รอยหยักฟันปลา</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS20')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS20')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>mm.</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>เฉดสีกระดาษ</td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS21')
				  {
					echo $r['value_start'];
				  }
			  }
			  ?></td>
            <td><?php 
			  foreach($rs2 as $r)
			  {
				  if($r['data_name']=='foliosheetFS21')
				  {
					echo $r['value_end'];
				  }
			  }
			  ?></td>
            <td>1 = ไม่ต่าง,2= แตกต่าง</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><strong>ปัญหาที่พบตามลักษณะ</strong></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td></td>
            <td></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </tbody>
      </table>
    <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
						columns: [
						{ field: "Properties1", width: "40px" },
						{ field: "Value11", width: "10px" },
						{ field: "Value12", width: "10px" },
						{ field: "Unit1",  width: "20px" },
						{ field: "Properties2", width: "40px" },
						{ field: "Value21", width: "10px" },
						{ field: "Value22", width: "10px" },
						{ field: "Unit2", width: "20px" }
						],
                        //height: 1000,
						//pageable: true,
						dataSource: {
						//pageSize: 12
						} 
                    });
                });
            </script></td>
  </tr>
</table>

<!--scrip list select--> 
<script>
                $(document).ready(function() {
                    var viewModel = {
                        chosenTicket: ko.observable(),
                        resetTicket: function() { this.chosenTicket(null) },
                    };
                    $("#ticket1").kendoDropDownList().trigger("change");
                    $("#ticket2").kendoDropDownList().trigger("change");
                    $("#ticket3").kendoDropDownList().trigger("change");
                    $("#ticket4").kendoDropDownList().trigger("change");
                    $("#ticket5").kendoDropDownList().trigger("change");
                    $("#ticket6").kendoDropDownList().trigger("change");
                    $("#ticket7").kendoDropDownList().trigger("change");
                });
      		</script> 
<!--scrip วัน-เดือน-ปี--> 
<script>
                $(document).ready(function() {
                    var today = new Date(),
                        birthdays = [
                           +new Date(today.getFullYear(), today.getMonth(), 11),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 6),
                           +new Date(today.getFullYear(), today.getMonth() + 1, 27),
                           +new Date(today.getFullYear(), today.getMonth() - 1, 3),
                           +new Date(today.getFullYear(), today.getMonth() - 2, 22)
                        ];

                    $("#datepicker").kendoDatePicker({
                        value: today,
                        month: {
                            // template for dates in month view
                            content: '# if ($.inArray(+data.date, [' + birthdays + ']) != -1) { #' +
                                         '<div class="birthday"></div>' +
                                     '# } #' +
                                     '#= data.value #'
                        },
                        footer: "Today - #=kendo.toString(data, 'd') #"
                    });

                    $("#datepicker").data("kendoDatePicker")
                                    .dateView.calendar.element
                                    .width(300);
                });
            </script> 
<!--scrip เวลา--> 
<script>
                $(document).ready(function() {
                    // create TimePicker from input HTML element
                    $("#timepicker").kendoTimePicker();
                });
            </script>